package com.class04.advice;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2024/3/12 15:11
 */
@Component
@Aspect
@Order(6)
public class LogAdvice {
    @Before("execution(* com.class04.service.impl.*.*(..))")
    public void before(JoinPoint point) {
        String simpleName = point.getTarget().getClass().getSimpleName();
        System.out.println("before: " + simpleName + " " +
                point.getSignature().getName());
        String methodName = point.getSignature().getName();
        System.out.println("method: " + methodName);


    }
}
